//
//  SubReaderView.m
//  BoYue
//
//  Created by drouce on 16/2/27.
//  Copyright © 2016年 drouce. All rights reserved.
//

#import "SubReaderView.h"

@implementation SubReaderView

//-(instancetype)init {
//    if (self = [super init]) {
//        [self addSubview:self.titleLb];
//        [self addSubview:self.sourceLb];
//        [self addSubview:self.timeLb];
//        [self addSubview:self.contentLb];
//        [self addSubview:self.iconView];
//    }
//    return self;
//}

- (UILabel *)titleLb {
    if(_titleLb == nil) {
        _titleLb = [[UILabel alloc] init];
        
        //[self.scroll addSubview:_titleLb];
        [_titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(20);
            make.left.mas_equalTo(10);
            make.right.mas_equalTo(-10);
        }];
        _titleLb.font = [UIFont systemFontOfSize:18];
        _titleLb.numberOfLines = 0;
    }
    return _titleLb;
}

- (UILabel *)sourceLb {
    if(_sourceLb == nil) {
        _sourceLb = [[UILabel alloc] init];
        
        //[self.scroll addSubview:_sourceLb];
        [_sourceLb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.titleLb.mas_bottom).mas_equalTo(15);
            make.leftMargin.mas_equalTo(self.titleLb.mas_leftMargin);
            
        }];
        _sourceLb.font = [UIFont systemFontOfSize:15];
        _sourceLb.textColor = [UIColor lightGrayColor];
    }
    return _sourceLb;
}

- (UILabel *)timeLb {
    if(_timeLb == nil) {
        _timeLb = [[UILabel alloc] init];
        //[self.timeLb addSubview:self];
        //[self.scroll addSubview:_timeLb];
        [_timeLb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.sourceLb.mas_right).mas_equalTo(10);
            make.topMargin.mas_equalTo(self.sourceLb.mas_topMargin);
        }];
        
        _timeLb.font = [UIFont systemFontOfSize:15];
        _timeLb.textColor = [UIColor lightGrayColor];
    }
    return _timeLb;
}

- (UILabel *)contentLb {
    if(_contentLb == nil) {
        _contentLb = [[UILabel alloc] init];
        //[self.contentLb addSubview:self];
        //[self.scroll addSubview:_contentLb];
        [_contentLb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.timeLb.mas_bottom).mas_equalTo(15);
            make.left.mas_equalTo(10);
            make.right.mas_equalTo(-10);
        }];
        _contentLb.font = [UIFont systemFontOfSize:18];
        _contentLb.numberOfLines = 0;
    }
    return _contentLb;
}

- (TRImageView *)iconView {
    if(_iconView == nil) {
        _iconView = [[TRImageView alloc] init];
        //[self.iconView addSubview:self];
        //[self.scroll addSubview:_iconView];
        [_iconView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.contentLb.mas_bottom).mas_equalTo(10);
            make.left.mas_equalTo(10);
            make.right.mas_equalTo(-10);
            //make.height.mas_equalTo(50);
        }];
    }
    return _iconView;
}


//
//- (UIScrollView *)scroll {
//    if(_scroll == nil) {
//        _scroll = [[UIScrollView alloc] initWithFrame:self.frame];
//        _scroll.contentSize = CGSizeMake(200, 1200);
//        
//    }
//    return _scroll;
//}


@end
